package com.service;

import java.sql.Date;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.dao.GroupDao;
import com.model.Group;

@Service("groupService")
@Transactional
public class GroupServiceImpl implements GroupService{

	@Autowired
	private GroupDao groupDao;
	
	
	public void add(String branchId,Group group) {
		groupDao.add(branchId,group);		
	}

	public List<Group> getAllForAdmin() {
		return groupDao.getAllForAdmin();
	}

	public Group get(Integer id) {
		return groupDao.get(id);
	}

	public void delete(Integer id) {
		groupDao.delete(id);

	}

	public List<Group> getByDate(Date from,Date to)
	{
		return groupDao.getByDate(from, to);
	}


	public List<Group> getAll(int page) {
		return groupDao.getAll(page);

	}

	public int getNoOfRecords() {
		return groupDao.getNoOfRecords();
	}

	@SuppressWarnings("rawtypes")
	@Override
	public List getGroupName() {
				return groupDao.getGroupName();
	}

	@Override
	public List<Group> getAllForUser(String name) {
			return groupDao.getAllForUser(name);
	}

}
